home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Extra 1997 #1
/
Amiga Plus Extra 1997 #1.iso
/
programme
/
tools
/
leoutils
/
leolib.h
< prev
next >
Wrap
C/C++ Source or Header
|
1994-05-18
|
1KB
|
32 lines
#ifndef LEO_LIB_H
#define LEO_LIB_H
extern unsigned char __LeoCType[];
#define _U 1 /* upper case flag */
#define _L 2 /* lower case flag */
#define _N 4 /* number flag */
#define _S 8 /* space flag */
#define _P 16 /* punctuation flag */
#define _C 32 /* control character flag */
#define _B 64 /* blank flag */
#define _X 128 /* hexadecimal flag */
#define ToLower(c) (IsUpper(c) ? ((c)+('a'-'A')) : (c))
#define ToUpper(c) (IsLower(c) ? ((c)-('a'-'A')) : (c))
#define IsAlnum(c) (__LeoCType[(c)+1] & (_U|_L|_N))
#define IsAlpha(c) (__LeoCType[(c)+1] & (_U|_L))
#define IsCntrl(c) (__LeoCType[(c)+1] & _C)
#define IsDigit(c) (__LeoCType[(c)+1] & _N)
#define IsGraph(c) (__LeoCType[(c)+1] & (_P|_U|_L|_N))
#define IsLower(c) (__LeoCType[(c)+1] & _L)
#define IsPrint(c) (__LeoCType[(c)+1] & (_P|_U|_L|_N|_B))
#define IsPunct(c) (__LeoCType[(c)+1] & _P)
#define IsSpace(c) (__LeoCType[(c)+1] & _S)
#define IsUpper(c) (__LeoCType[(c)+1] & _U)
#define IsXDigit(c) (__LeoCType[(c)+1] & _X)
#endif